package com.lpf.hotelsystem.controller;

import com.lpf.hotelsystem.pojo.Admin;
import com.lpf.hotelsystem.service.impl.LoginServiceImp;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/login")
@Api(value = "登录接口",tags = "登录接口API")
public class LoginController {
    @Resource
    private LoginServiceImp loginService;

    @PostMapping("/adminLogin")
    public Map<String, Object> login(@RequestBody Admin admin) {
        System.out.println("username ===== " +admin.getUsername());
        System.out.println("password ===== " + admin.getUserpass());
        return loginService.login(admin.getUsername(), admin.getUserpass());
    }
}
